﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <meta name="viewport" content="width=device-width" />
    <title></title>
</head>
<body>
    <div>
        <table class="easyui-datagrid" id="settlist" data-options="rownumbers:true">
        </table>

         <div id="dlgsett" class="easyui-dialog" title="结算" style="width: 450px; height: 200px;"
        data-options="iconCls:'icon-add',resizable:true,modal:true,closed: true">
        <%using (Html.BeginForm("sttel", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))%>
        <%{%>
        <table cellspacing="0" cellpadding="0" border="0" style="width: 77%">
            <tr>
                <td height="25" width="30%" align="right">入住时间
	：</td>
                <td height="25"  align="left">
                    <input id ="ids" name="ids" type="text"  style="display:none"/>
                    <label  id ="timein" ></label></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">结算时间：</td>
                <td height="25" width="*" align="left">
                    <label  id ="timeout" ><%=DateTime.Now.ToString() %></label>
                    &nbsp;</td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">应付金额：</td>
                <td height="25" width="*" align="left">
                  <input  id ="pri" name="pri" type="text" value="" />
            </tr>
            <tr>
                <td height="25" width="30%" align="right"></td>
                <td height="25" width="*" align="left">
                   
                    <input type="submit" value="结算" />
                </td>

            </tr>
        </table>
        <%} %>


    </div>

    <script type="text/javascript">
        $('#settlist').datagrid({
            url: '../admin/Getsettlist',
            singleSelect: true,
            columns: [[
             { field: 'name', title: '姓名', width: 50 },
             { field: 'email', title: '邮箱', width: 100 },
             { field: 'phone', title: '电话', width: 100 },
             { field: 'title', title: '房间', width: 70 },
             { field: 'time', title: '时间', width: 100 },
             { field: 'context', title: '备注', width: 100 },
             { field: 'is_chack', title: '是否已确定', width: 60 },
             { field: 'chekin', title: '是否已入住', width: 60 },
             {
                 field: 'opt', title: '结算', width: 60, align: 'center',
                 formatter: function (value, rec) {
                     var btn = "<a href=" + "javascirpt:void(0)" + " class=" + "easyui-linkbutton" + " iconcls=" + "icon-edit" + " onclick=" + "opt1(" + rec.id + ",'" + rec.time + "')" + " plain=" + "true" + ">结算</a>";
                     return btn;
                 }
             }
            ]]
        });

        function opt1(rec,ti) {
            var myDate = new Date();
            myDate.toLocaleDateString();
            var Date = myDate;
            $('#pri').val = Date;
            $('#ids').val = rec;
            $('#timein').val = ti;
            $('#dlgsett').dialog('open');
        }

    </script>
</body>
</html>
